package com.hsq.androidproject.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.lenovo.androidproject3.R;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/3/12.
 */

public class MysousuolishiAdapter  extends BaseAdapter{
    Context context;
    List<String> list=new ArrayList<>();

    public MysousuolishiAdapter(Context context, List<String> list) {
        this.context = context;
        this.list = list;
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public Object getItem(int position) {
        return list.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        TextView textView;
        convertView= LayoutInflater.from(context).inflate(R.layout.list_sousuo_listitem,parent,false);
        textView= (TextView) convertView.findViewById(R.id.listhitv);
        textView.setText(list.get(position));
        return convertView;
    }
}
